﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Medical_Store_Billing.Business_Login_Layer;

namespace Medical_Store_Billing
{
    public partial class Form_timkiemphieunhap : Form
    {
        PhieunhapBLL m_phieunhapbll = new PhieunhapBLL();
        PhieunhapBLL m_phieunhapbll1 = new PhieunhapBLL();
        String maphieunhap = null;
        public Form_timkiemphieunhap()
        {
            InitializeComponent();
        }

        private void Form_timkiemphieunhap_Load(object sender, EventArgs e)
        {
            dataGridView1.DataSource = m_phieunhapbll.Laydsphieunhap();
            dataGridView1.Show();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            
            String maphieunhap_tk = textBox1.Text.ToString();
            dataGridView1.DataSource =  m_phieunhapbll.Timphieunhap(maphieunhap_tk);

            dataGridView1.Refresh();
        }

        private void dataGridView1_RowEnter(object sender, DataGridViewCellEventArgs e)
        {
            int i = e.RowIndex;
            this.maphieunhap = dataGridView1.Rows[i].Cells[0].Value.ToString();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            
            MessageBox.Show(""+this.maphieunhap);
            dataGridView2.DataSource = m_phieunhapbll1.laychitietphieunhap(maphieunhap);
            dataGridView2.Show();
            dataGridView2.Refresh();
        }


    }
}
